package com.pactera.openresource.adapter;

//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.integration.Message;
//import org.springframework.integration.MessageHandlingException;
//import org.springframework.integration.endpoint.AbstractEndpoint;
//import org.springframework.stereotype.Component;
import org.springframework.integration.support.MessageBuilder;

//@Component("clientServiceActivator")
public class ClientServiceActivator {
	

	/**
	 * Receives the result from a succesful service invocation. Flow finishes here.
	 * @param msg
	 */
	public Message<?> handleServiceResult(Message<?> msg) {
//	public void handleServiceResult(Message<?> msg) {
		System.out.println("msg.getHeaders() = " + msg.getHeaders());
		System.out.println("msg.getPayload() = " + msg.getPayload());
		
		return MessageBuilder.fromMessage(msg)
				.copyHeadersIfAbsent(msg.getHeaders())
				.setHeader("STATUSCODE_HEADER", "HttpStatus.NOT_FOUND")
				.build();
		
	}
	
//	
}
